﻿using System;
using System.Collections.Generic;
using NHibernate;
using NHibernate.Cfg;

namespace gms.system {
	public class NHDatabase : IDisposable {
		private Configuration config { get; set; }
		private ISessionFactory factory { get; set; }
		public ISession session { get; set; }

		public NHDatabase() {
			config = new Configuration();
			config.AddAssembly("Game Management Library");

			factory = config.BuildSessionFactory();

			session = factory.OpenSession();
		}

		public void Dispose() {
			session.Disconnect();
		}
	}
}